﻿using SmartHotel.DAL;
using SmartHotel.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SmartHotel.BLL
{
    public class RoomInfoBLL
    {
        public RoomInfoBLL(RoomInfoDAL roomInfoDAL)
        {
            RoomInfoDAL = roomInfoDAL;
        }

        public RoomInfoDAL RoomInfoDAL { get; }


        public int AddRoom(RoomInfo roomInfo)
        {
            
            return RoomInfoDAL.AddRoom(roomInfo);
        }
        /// <summary>
        /// 根据id查房间号
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public RoomInfo GetRoomInfoById(int id)
        {
            return RoomInfoDAL.GetRoomInfoById(id);
        }

        public int DeleteRoom(int id)
        {
            return RoomInfoDAL.DeleteRoom(id);
        }


        public int Update(RoomInfo roomInfo)
        {
            return RoomInfoDAL.Update(roomInfo);
        }
        /// <summary>
        /// 根据房型id查找房型对应的所有房间
        /// </summary>
        /// <param name="roomTypeId"></param>
        /// <returns></returns>
        public List<RoomInfo> GetRooms(int roomTypeId)
        {
            return RoomInfoDAL.GetRooms(roomTypeId);
        }
    }
}
